<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>接收消息</title>
</head>
<body>
<h2>接收 RabbitMQ 消息</h2>
<button onclick="getMessage()">获取最新消息</button>
<p id="msg"></p>

<script>
    function getMessage() {
        fetch('/mq/register')
            .then(resp => resp.text())
            .then(data => document.getElementById('msg').innerText = data)
            .catch(err => document.getElementById('msg').innerText = '接收失败: ' + err);
    }
</script>
</body>
</html>
